<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!doctype html>
<html>

<head>
    <meta charset="utf-8" />
    <title>${novel.name}</title>
    <style>
        form {
            margin: 0;
        }
        
        textarea {
            display: block;
        }
        
        .left {
            height: 700px;
            width: 20%;
            float: left;
            padding: 40px;
        }
        
        .right {
            float: right;
            /* border: 1px solid black; */
            height: 800px;
            width: 78.5%;
        }
        
        .huoqu {
            height: 160px;
            width: 1180px;
            margin: 50px 0px 0px 0px;
        }
        
        .a {
            float: left;
            height: 100%;
            width: 45%;
            /* border: 1px solid black; */
        }
        
        .b {
            float: left;
            height: 100%;
            width: 45%;
            /* border: 1px solid black; */
        }
        
        .right1 {
            padding: 20px;
        }
    </style>

    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/default.css" />
    <script charset="utf-8" src="${pageContext.request.contextPath}/static/js/kindeditor-min.js"></script>
    <script charset="utf-8" src="${pageContext.request.contextPath}/static/js/zh_CN.js"></script>


    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/tool/bootstrap/css/bootstrap.min.css">
    <script src="${pageContext.request.contextPath}/static/tool/jquery.js"></script>
    <script src="${pageContext.request.contextPath}/static/tool/bootstrap/js/bootstrap.min.js"></script>
    <script>
        KindEditor.ready(function(K) {
            K.create('textarea[name="content"]', {
                filterMode: false
            });
        });
    </script>
</head>

<body>
    <div class="left">
        <table class="table">
            <caption><h3>小说：${novel.name}</h3></caption>
            <c:forEach items="${quarterVo}" var="quarter">
                <thead>
                <tr>
                    <th>${quarter.quarterName}</th>
                </tr>
                </thead>
                <tbody>
                <c:forEach items="${quarter.chapters}" var="chapter">
                    <tr>
                        <td><a href="${pageContext.request.contextPath}/author/seeChapter/${chapter.id}">
                                ${chapter.chapterNoZh} ${chapter.chapterName}
                        </a></td>
                    </tr>
                </c:forEach>
                </tbody>
            </c:forEach>
        </table>

    </div>
    <div class="right">
        <!-- 右上部 -->
        <div class="huoqu">
            <form action="${pageContext.request.contextPath}/author/writeChapter" method="post">
                <input type="hidden" value="${chapter.id}" name="id">
                <input type="hidden" value="${novel.id}" name="novelId">
                <input type="hidden" value="${chapter.quarterNo}" name="quarterNo">
                <input type="hidden" value="${chapter.chapterNo}" name="chapterNo">
<%--                <input type="hidden" value="${chapter.createTime}" name="createTime">--%>
                <div class="panel panel-default">
                    <div class="panel-heading">${novel.name}</div>
                    <div class="panel-body">
                        <!-- 右上部左边 -->
                        <div class="a form-horizontal" >
                            <div class="form-group">
                                <label for="quarterNoZh" class="col-sm-2 control-label">卷</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" name="quarterNoZh" id="quarterNoZh" value="${chapter.quarterNoZh}" placeholder="请输入券序号">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="chapterNoZh" class="col-sm-2 control-label">章节</label>
                                <div class="col-sm-10">
                                    <input type="text" name="chapterNoZh"  class="form-control" value="${chapter.chapterNoZh}" id="chapterNoZh" placeholder="请输入章节序号">
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-offset-2 col-sm-10">

                                </div>
                            </div>
                            <label for="content" class="col-sm-2 control-label">内容：</label>


                        </div>
                        <!-- 右上部右边 -->
                        <div class="b form-horizontal">
                            <div class="form-group">
                                <label for="quarterName" class="col-sm-2 control-label">卷名称</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" value="${chapter.quarterName}" name="quarterName" id="quarterName" placeholder="请输入卷名称">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="chapterName" class="col-sm-2 control-label">章节名称</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control"  value="${chapter.chapterName}" name="chapterName" id="chapterName" placeholder="请输入章节名称">
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-offset-2 col-sm-10">

                                </div>
                            </div>

                        </div>
                    </div>
                    <textarea name="content"  id="content"  style="width:1100px;height:400px;">
                        ${chapter.content}
                    </textarea>
                    <div class="panel-footer">
                        <button type="submit" id="btn" class="btn btn-primary">提 &ensp;&ensp;交</button> &ensp;&ensp;&ensp;&ensp;
                    </div>
                </div>
            </form>

        </div>


    </div>
</body>
<script src="${pageContext.request.contextPath}/static/tool/layer/layer.js"></script>
<script>
    <c:if test="${add == 'true'}">
    layer.msg("章节信息撰写成功，等待管理员审核");
    </c:if>
    <c:if test="${add == 'false'}">
    layer.msg("章节信息撰写失败");
    </c:if>
    <c:if test="${edit == 'true'}">
    layer.msg("章节信息编辑成功，等待管理员审核");
    </c:if>
</script>


</html>